<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMembersTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('members', function(Blueprint $table)
		{
			//用户表
			$table->engine = 'InnoDB';

			$table->increments('id');

			// 昵称
			$table->string('nickname');

			// 手机号
			$table->string('mobile', 20)
				->unique()
				->nullable();

			// 密码
			$table->string('password', 64);

			// 头像
			$table->char('avatar_id', 18)->default('');
			
			//验证token
			$table->string('user_token');

			// remember_token
			$table->string('remember_token', 100)->nullable();

			$table->timestamps();
			$table->softDeletes();
			$table->index('deleted_at');
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('members');
	}

}
